package zp_login_v1

import (
	"context"

	"github.com/gogf/gf/v2/encoding/gjson"
	"github.com/gogf/gf/v2/frame/g"
)

/*
	s.Group("/", func(group *ghttp.RouterGroup) {
		group.Group("/", func(group *ghttp.RouterGroup) {
			group.Bind(controller.ZpLoginV1Controller)
		})
	})
*/
var ZpLoginV1Controller = cZpLoginV1Controller{}

type cZpLoginV1Controller struct{}
type PhoneGetCodeReq struct {
	g.Meta `path:"zp_login_v1/phoneGetCode" method:"POST" summary:""`
	Any    string `json:"any" dc:"zp_login_v1/phoneGetCode"`
	Phone  string `json:"phone" dc:"13720984421"`
}
type PhoneGetCodeRes struct {
}

func (a *cZpLoginV1Controller) PhoneGetCodeAction(ctx context.Context, req *PhoneGetCodeReq) (res *PhoneGetCodeRes, err error) {
	res = &PhoneGetCodeRes{}
	data := `{"code":1,"msg":"短信发送成功","time":"1733797102","data":null}`
	js := gjson.New(data)
	js.Scan(&res)
	return
}

type MemberPhoneLoginReq struct {
	g.Meta `path:"zp_login_v1/memberPhoneLogin" method:"POST" summary:""`
	Phone  string `json:"phone" dc:"13720984421"`
	Type   string `json:"type" dc:"0"`
	Any    string `json:"any" dc:"zp_login_v1/memberPhoneLogin"`
	Code   string `json:"code" dc:"859431"`
}
type MemberPhoneLoginRes struct {
	Token string `json:"token"`
}

func (a *cZpLoginV1Controller) MemberPhoneLoginAction(ctx context.Context, req *MemberPhoneLoginReq) (res *MemberPhoneLoginRes, err error) {
	res = &MemberPhoneLoginRes{}
	data := `{"token":"4305a7b322c68135fd3d09f57346fee2"}`
	js := gjson.New(data)
	js.Scan(&res)
	return
}
